package com.bigflexlib.x.mx.collections.errors
{
	import mx.collections.errors.ItemPendingError;
	import mx.rpc.IResponder;


	/**
	 * 
	 * An item pending error that adds methods to call all responders
	 * ( something that's strangely missing from the original class )
	 * 
	 * @author aldo.bucchi@gmail.com
	 * 
	 */
	public class ItemPendingError2 extends ItemPendingError
	{
	
		public function ItemPendingError2(message:String)
		{
			super(message);
		}
		
		public function dataReady(data:Object):void
		{
			if (responders) 
			{
				responders.forEach(
					function(item:IResponder, index:int, arr:Array):void
					{
						item.result(data);					
					});
			}
		}
		
		public function dataError(error:Object):void
		{
			if (responders)
			{
				responders.forEach(
					function(item:IResponder, index:int, arr:Array):void
					{
						item.fault(error);					
					});				
			}
		}
	}
}